setwd('~/Desktop/PLS397/')
#Looking to find what drives car sales in the US, 
#and to see if we can predict car sales in the coming years after the current recession
#-#--------------------------------------------------------------------------#-#

#read in csv data
car_sales = read_csv("ALTSALES.csv")
## Parsed with column specification:
## cols(
##   DATE = col_date(format = ""),
##   ALTSALES = col_double()
## )
#clean up data 
car_sales <- mutate(car_sales, Sales = ALTSALES )
car_sales <- subset(car_sales, select = -ALTSALES )
car_sales <- mutate(car_sales, Date = DATE )
car_sales <- subset(car_sales, select = -DATE )
car_sales <- na.omit(car_sales)
library(plotly)
## Warning: package 'plotly' was built under R version 3.6.2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggmap':
## 
##     wind
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(shiny)
#inteactive plot of car sales over time in the US
#car_plot = plot_ly(car_sales, x = ~Date, y = ~Sales, type= 'scatter', mode='lines') 

car_plot <- plot_ly() %>% 
  add_trace(data = car_sales,
            x = ~Date,
            y = ~Sales,
            colors = "BrBG",
            type = "scatter",
            mode = "line") %>% 
  layout(title = "Car Sales x Time",
         xaxis = list(title = "Date"))


htmlwidgets::saveWidget(car_plot, "CarSales.html")
car_plot
getwd()
## [1] "/Users/carsondobozy/Desktop"
setwd("~/Desktop/PLS397")
#Unemployment Numbers CSV data
#chose unemployment becuase that seems to be one of the biggest deciding factors of car sales 
#after doing research
Unemployment = read_csv("CCSA.csv")
## Parsed with column specification:
## cols(
##   DATE = col_date(format = ""),
##   CCSA = col_character()
## )
Unemployment <- mutate(Unemployment, Unemployed = CCSA )
Unemployment <- subset(Unemployment, select = -CCSA )
Unemployment <- mutate(Unemployment, Date = DATE )
Unemployment <- subset(Unemployment, select = -DATE )
Unemployment <- na.omit(Unemployment)

Unemployment$Unemployed = as.numeric(as.character(Unemployment$Unemployed))
## Warning: NAs introduced by coercion
#Make sure data is numeric
is.num <- sapply(Unemployment, is.numeric)
Unemployment[is.num] <- lapply(Unemployment[is.num], round, 8)
Unemployment
## # A tibble: 640 x 2
##    Unemployed Date      
##         <dbl> <date>    
##  1    1118750 1967-01-01
##  2    1162500 1967-02-01
##  3    1243250 1967-03-01
##  4    1281000 1967-04-01
##  5    1277500 1967-05-01
##  6    1246000 1967-06-01
##  7    1246200 1967-07-01
##  8    1209250 1967-08-01
##  9    1181400 1967-09-01
## 10    1172250 1967-10-01
## # … with 630 more rows
#plot to show unemployment over time
Unemp_plot <- plot_ly() %>% 
  add_trace(data = Unemployment,
            x = ~Date,
            y = ~Unemployed,
            colors = "red",
            type = "scatter",
            mode = "line") %>% 
  layout(title = "People on Unemployment x Time",
         xaxis = list(title = "Date"))




Unemp_plot
## Warning: Ignoring 1 observations
set.seed(420)
#train and test data for car sales 
split1=caTools::sample.split(car_sales$Sales,SplitRatio = 0.8)
training_set1=subset(car_sales,split1==TRUE)
test_set1=subset(car_sales,split1==FALSE)

#Fitting regression model to the training set with unemployment levels
regressor1=lm(formula=car_sales$Sales[0:531]~Unemployment$Unemployed[109:639],
                data=training_set1)

#Predicting the test set
y_pred1=predict(regressor1,newdata=test_set1)
## Warning: 'newdata' had 107 rows but variables found have 531 rows
#predicted car sales model (unemployment regression) 
new_date1 = car_sales$Date[0:531]
car_pred1 = plot_ly(car_sales, x = new_date1, y = y_pred1, type= 'scatter', mode='lines', color='red') 




car_pred1
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
#subplot to show Original Data vs model

#here is our first predicted time series with just Unemp an predictor

subplot(car_plot, car_pred1, nrows = 2, margin = 0.05, shareX = TRUE)
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
getwd()
## [1] "/Users/carsondobozy/Desktop"
setwd("~/Desktop/PLS397")
#Consumption levels CSV data
#Consumption is obviously related to car sales, and has good response to major issues that cause market disruption
#i.e 9/11 attacks, 2008 market crash, corona virus pandemic
Consumption = read_csv("PCEDG.csv")
## Parsed with column specification:
## cols(
##   DATE = col_date(format = ""),
##   PCEDG = col_double()
## )
Consumption <- mutate(Consumption, Personal_Consumption = PCEDG )
Consumption <- subset(Consumption, select = -PCEDG )
Consumption <- mutate(Consumption, Date = DATE )
Consumption <- subset(Consumption, select = -DATE )
Consumption <- na.omit(Consumption)
#make sure data is numeric 
Consumption <- rbind(Consumption, c(1124.0, "2020-03-01"))
Consumption <- transform(Consumption, Personal_Consumption = as.numeric(Personal_Consumption))
head(Consumption)
##   Personal_Consumption       Date
## 1                 42.3 1959-01-01
## 2                 44.2 1959-02-01
## 3                 44.4 1959-03-01
## 4                 45.1 1959-04-01
## 5                 45.4 1959-05-01
## 6                 46.0 1959-06-01
set.seed(420)
#train and test data for car sales 
split2=caTools::sample.split(car_sales$Sales,SplitRatio = 0.8)
training_set2=subset(car_sales,split2==TRUE)
test_set2=subset(car_sales,split2==FALSE)

#Fitting regression model to the training set Unemployment and Consumption
regressor2=lm(formula=car_sales$Sales[0:531]~Unemployment$Unemployed[109:639] + Consumption$Personal_Consumption[205:735],
                data=training_set2)

#Predicting the test set
y_pred2=predict(regressor2,newdata=test_set2)
## Warning: 'newdata' had 107 rows but variables found have 531 rows
#prediction model 2 (accounts for more variation)


new_date2 = car_sales$Date[0:531]
car_pred2 = plot_ly(car_sales, x = new_date2, y = y_pred2, type= 'scatter', mode='lines', color='red') 




car_pred2
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
#subplot to show our two models vs actual data

#here we can see our model is becoming more accurate and more sensetive to volatility

subplot(car_plot, car_pred1, car_pred2, nrows = 3, margin = 0.05, shareX = TRUE)
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
getwd()
## [1] "/Users/carsondobozy/Desktop"
setwd("~/Desktop/PLS397")
#Gas prices csv data
#Gas prices will give our model a better sensitivity and feel for how car sales move over time 
GasPrices = read_csv("APU000074714.csv")
## Parsed with column specification:
## cols(
##   DATE = col_date(format = ""),
##   APU000074714 = col_double()
## )
GasPrices <- mutate(GasPrices, Gas_Price = APU000074714 )
GasPrices <- subset(GasPrices, select = -APU000074714 )
GasPrices <- mutate(GasPrices, Date = DATE )
GasPrices <- subset(GasPrices, select = -DATE )
GasPrices <- na.omit(GasPrices)
#create dataframe with all variables 
data = data.frame(Date = new_date1[0:531],
                  CarSales = car_sales$Sales[0:531],
                  Unemployed = Unemployment$Unemployed[109:639],
                  Consumption = Consumption$Personal_Consumption[205:735],
                  GasPrice = GasPrices$Gas_Price[0:531]
                  )

data
##           Date CarSales Unemployed Consumption GasPrice
## 1   1976-01-01   12.512    3035200       161.2    0.605
## 2   1976-02-01   13.044    2865750       164.2    0.600
## 3   1976-03-01   13.085    2843000       164.5    0.594
## 4   1976-04-01   12.915    2872250       167.6    0.592
## 5   1976-05-01   12.645    2941000       162.2    0.600
## 6   1976-06-01   12.727    2989500       167.9    0.616
## 7   1976-07-01   13.122    2995800       169.7    0.623
## 8   1976-08-01   12.594    3015250       168.7    0.628
## 9   1976-09-01   13.209    3070000       171.2    0.630
## 10  1976-10-01   12.537    3093000       170.9    0.629
## 11  1976-11-01   13.006    3055750       173.2    0.629
## 12  1976-12-01   14.197    2923500       182.2    0.626
## 13  1977-01-01   14.019    2827200       177.8    0.627
## 14  1977-02-01   14.335    2849000       184.1    0.637
## 15  1977-03-01   14.782    2702750       189.9    0.643
## 16  1977-04-01   14.753    2671200       188.9    0.651
## 17  1977-05-01   14.605    2631250       188.6    0.659
## 18  1977-06-01   14.571    2619250       190.2    0.665
## 19  1977-07-01   14.306    2583000       191.7    0.667
## 20  1977-08-01   14.488    2610500       194.2    0.667
## 21  1977-09-01   14.274    2589500       196.1    0.666
## 22  1977-10-01   14.511    2576200       197.1    0.665
## 23  1977-11-01   14.396    2568500       200.8    0.664
## 24  1977-12-01   14.789    2507000       204.2    0.665
## 25  1978-01-01   13.334    2493500       191.2    0.648
## 26  1978-02-01   13.969    2555500       198.5    0.647
## 27  1978-03-01   14.714    2499750       204.7    0.647
## 28  1978-04-01   15.757    2349600       213.5    0.649
## 29  1978-05-01   15.830    2231500       217.0    0.655
## 30  1978-06-01   15.868    2221750       218.1    0.663
## 31  1978-07-01   15.086    2313200       215.3    0.674
## 32  1978-08-01   15.676    2398000       221.8    0.682
## 33  1978-09-01   14.195    2269800       213.1    0.688
## 34  1978-10-01   15.391    2230500       220.3    0.690
## 35  1978-11-01   15.015    2223750       222.3    0.695
## 36  1978-12-01   14.839    2286600       224.2    0.705
## 37  1979-01-01   14.626    2382500       220.5    0.716
## 38  1979-02-01   14.856    2414250       224.0    0.730
## 39  1979-03-01   14.839    2385800       225.3    0.755
## 40  1979-04-01   14.304    2398500       222.7    0.802
## 41  1979-05-01   13.966    2259250       224.4    0.844
## 42  1979-06-01   12.363    2251600       219.3    0.901
## 43  1979-07-01   13.712    2358500       226.0    0.949
## 44  1979-08-01   13.999    2458250       231.3    0.988
## 45  1979-09-01   13.953    2428200       235.4    1.020
## 46  1979-10-01   12.733    2490000       228.3    1.028
## 47  1979-11-01   12.667    2602500       229.0    1.041
## 48  1979-12-01   13.198    2698800       229.9    1.065
## 49  1980-01-01   14.115    2781750       239.6    1.131
## 50  1980-02-01   12.967    2868500       232.9    1.207
## 51  1980-03-01   11.797    2881200       223.6    1.252
## 52  1980-04-01   10.198    3126500       212.4    1.264
## 53  1980-05-01    9.310    3544800       208.5    1.266
## 54  1980-06-01   10.181    3832500       214.9    1.269
## 55  1980-07-01   11.381    3845500       226.7    1.271
## 56  1980-08-01   10.860    3805200       224.0    1.267
## 57  1980-09-01   10.622    3693500       225.4    1.257
## 58  1980-10-01   11.146    3556250       236.3    1.250
## 59  1980-11-01   11.014    3300600       236.7    1.250
## 60  1980-12-01   10.718    3125500       235.7    1.258
## 61  1981-01-01   11.036    3038200       239.9    1.298
## 62  1981-02-01   12.116    2978000       247.3    1.382
## 63  1981-03-01   12.185    2899250       250.9    1.417
## 64  1981-04-01   10.212    2857000       241.7    1.412
## 65  1981-05-01   10.136    2904000       239.8    1.400
## 66  1981-06-01   10.205    2903250       241.4    1.391
## 67  1981-07-01   10.206    2883000       245.2    1.382
## 68  1981-08-01   12.457    2948400       260.4    1.376
## 69  1981-09-01   10.863    3013000       250.2    1.376
## 70  1981-10-01    9.209    3127000       237.3    1.371
## 71  1981-11-01    9.294    3337250       237.0    1.369
## 72  1981-12-01    8.849    3525250       236.3    1.365
## 73  1982-01-01   10.075    3533600       241.0    1.358
## 74  1982-02-01   10.725    3555500       249.3    1.334
## 75  1982-03-01   10.457    3655500       249.0    1.284
## 76  1982-04-01    9.541    3864500       244.9    1.225
## 77  1982-05-01   10.900    3991800       256.8    1.237
## 78  1982-06-01    9.420    4094250       246.0    1.309
## 79  1982-07-01    9.585    4101400       247.8    1.331
## 80  1982-08-01    9.779    4260250       248.6    1.323
## 81  1982-09-01   10.958    4452750       260.0    1.307
## 82  1982-10-01    9.981    4639600       254.1    1.295
## 83  1982-11-01   11.866    4601000       268.1    1.283
## 84  1982-12-01   11.073    4400000       270.8    1.260
## 85  1983-01-01   10.688    3919000       268.3    1.230
## 86  1983-02-01   10.441    3859250       266.8    1.187
## 87  1983-03-01   10.832    3767500       271.6    1.152
## 88  1983-04-01   11.507    3760200       281.7    1.215
## 89  1983-05-01   11.865    3624250       288.8    1.259
## 90  1983-06-01   12.785    3455500       298.2    1.277
## 91  1983-07-01   12.733    3189600       303.4    1.288
## 92  1983-08-01   12.048    3105750       301.2    1.285
## 93  1983-09-01   12.258    3007000       302.6    1.274
## 94  1983-10-01   13.103    2902800       313.7    1.255
## 95  1983-11-01   12.899    2787750       315.9    1.241
## 96  1983-12-01   14.278    2712200       328.3    1.231
## 97  1984-01-01   13.998    2549250       336.8    1.216
## 98  1984-02-01   14.130    2469500       328.7    1.209
## 99  1984-03-01   13.967    2424400       328.8    1.210
## 100 1984-04-01   14.094    2422250       336.0    1.227
## 101 1984-05-01   14.569    2385000       341.7    1.236
## 102 1984-06-01   14.394    2360400       346.1    1.229
## 103 1984-07-01   14.455    2353000       341.5    1.212
## 104 1984-08-01   14.006    2385750       339.7    1.196
## 105 1984-09-01   13.662    2434800       345.0    1.203
## 106 1984-10-01   14.342    2524000       343.0    1.209
## 107 1984-11-01   14.444    2584250       358.4    1.207
## 108 1984-12-01   14.306    2547000       360.1    1.193
## 109 1985-01-01   15.265    2552250       365.5    1.148
## 110 1985-02-01   15.432    2623500       364.9    1.131
## 111 1985-03-01   15.049    2564400       373.6    1.159
## 112 1985-04-01   15.224    2578750       365.7    1.205
## 113 1985-05-01   15.270    2560750       384.3    1.231
## 114 1985-06-01   14.800    2551800       369.7    1.241
## 115 1985-07-01   15.222    2542500       376.3    1.242
## 116 1985-08-01   16.633    2562600       390.3    1.229
## 117 1985-09-01   18.809    2580500       422.7    1.216
## 118 1985-10-01   13.887    2631750       379.2    1.204
## 119 1985-11-01   14.333    2625200       380.8    1.207
## 120 1985-12-01   15.387    2643750       391.2    1.208
## 121 1986-01-01   15.781    2604000       401.4    1.194
## 122 1986-02-01   15.126    2568500       389.4    1.120
## 123 1986-03-01   13.900    2593600       384.1    0.981
## 124 1986-04-01   15.579    2608750       404.0    0.888
## 125 1986-05-01   16.038    2671000       414.2    0.923
## 126 1986-06-01   15.637    2635000       403.7    0.955
## 127 1986-07-01   15.471    2608000       415.9    0.890
## 128 1986-08-01   17.010    2655600       434.4    0.843
## 129 1986-09-01   21.221    2707000       486.8    0.860
## 130 1986-10-01   14.516    2718750       434.9    0.831
## 131 1986-11-01   14.545    2630800       420.0    0.821
## 132 1986-12-01   17.782    2571250       468.5    0.823
## 133 1987-01-01   12.155    2512400       399.7    0.862
## 134 1987-02-01   14.830    2472000       427.0    0.905
## 135 1987-03-01   15.017    2429250       428.8    0.912
## 136 1987-04-01   15.167    2411000       437.6    0.934
## 137 1987-05-01   14.283    2324000       434.0    0.941
## 138 1987-06-01   15.341    2279000       445.7    0.958
## 139 1987-07-01   15.372    2196500       452.4    0.971
## 140 1987-08-01   16.786    2211600       468.9    0.995
## 141 1987-09-01   15.820    2196750       460.3    0.990
## 142 1987-10-01   13.975    2046800       443.1    0.976
## 143 1987-11-01   14.227    2082250       447.4    0.976
## 144 1987-12-01   15.354    2115500       459.4    0.961
## 145 1988-01-01   15.770    2188000       470.3    0.933
## 146 1988-02-01   16.172    2141500       468.7    0.913
## 147 1988-03-01   15.848    2112000       472.4    0.904
## 148 1988-04-01   15.201    2081200       467.8    0.930
## 149 1988-05-01   15.606    2067750       474.7    0.955
## 150 1988-06-01   15.525    2043000       477.3    0.955
## 151 1988-07-01   15.375    2065200       472.4    0.967
## 152 1988-08-01   15.078    2088000       470.1    0.987
## 153 1988-09-01   14.710    2075750       468.7    0.974
## 154 1988-10-01   14.815    2015600       477.9    0.957
## 155 1988-11-01   15.038    1978250       481.8    0.949
## 156 1988-12-01   16.098    2045200       498.9    0.930
## 157 1989-01-01   15.017    2061000       496.2    0.918
## 158 1989-02-01   14.668    2113750       481.3    0.926
## 159 1989-03-01   14.362    2131500       481.9    0.940
## 160 1989-04-01   15.698    2098800       500.4    1.065
## 161 1989-05-01   14.942    2093500       487.6    1.119
## 162 1989-06-01   14.065    2122750       492.0    1.114
## 163 1989-07-01   14.389    2179400       497.4    1.092
## 164 1989-08-01   16.234    2207250       518.7    1.057
## 165 1989-09-01   15.361    2208800       500.8    1.029
## 166 1989-10-01   13.270    2281000       493.9    1.027
## 167 1989-11-01   13.068    2285000       490.1    0.999
## 168 1989-12-01   13.273    2285000       491.6    0.980
## 169 1990-01-01   16.010    2354750       536.4    1.042
## 170 1990-02-01   14.066    2354000       505.9    1.037
## 171 1990-03-01   14.203    2363800       503.8    1.023
## 172 1990-04-01   14.009    2380250       505.7    1.044
## 173 1990-05-01   13.743    2390000       495.3    1.061
## 174 1990-06-01   13.867    2423800       494.3    1.088
## 175 1990-07-01   13.789    2471750       496.3    1.084
## 176 1990-08-01   13.582    2509250       489.3    1.190
## 177 1990-09-01   14.025    2595400       495.1    1.294
## 178 1990-10-01   13.483    2720750       486.1    1.378
## 179 1990-11-01   12.877    2888250       482.7    1.377
## 180 1990-12-01   12.702    2968200       474.0    1.354
## 181 1991-01-01   11.596    3088000       452.7    1.247
## 182 1991-02-01   12.175    3262750       467.0    1.143
## 183 1991-03-01   12.616    3419000       495.4    1.082
## 184 1991-04-01   11.825    3483250       474.4    1.104
## 185 1991-05-01   12.270    3486750       473.5    1.156
## 186 1991-06-01   12.505    3426800       477.8    1.160
## 187 1991-07-01   12.742    3307500       485.4    1.127
## 188 1991-08-01   12.352    3291800       479.8    1.140
## 189 1991-09-01   12.890    3296250       487.9    1.143
## 190 1991-10-01   12.015    3311000       474.1    1.122
## 191 1991-11-01   12.364    3310600       477.3    1.134
## 192 1991-12-01   12.420    3349250       480.9    1.123
## 193 1992-01-01   12.367    3353250       495.6    1.073
## 194 1992-02-01   12.698    3314600       501.3    1.054
## 195 1992-03-01   12.592    3312000       491.7    1.058
## 196 1992-04-01   12.310    3343750       490.0    1.079
## 197 1992-05-01   12.860    3344800       501.9    1.136
## 198 1992-06-01   13.317    3289750       511.0    1.179
## 199 1992-07-01   12.600    3217750       507.2    1.174
## 200 1992-08-01   12.620    3250200       511.9    1.158
## 201 1992-09-01   13.114    3204250       517.1    1.158
## 202 1992-10-01   13.368    3062400       522.7    1.154
## 203 1992-11-01   12.958    2949000       514.1    1.159
## 204 1992-12-01   13.514    2823750       532.4    1.136
## 205 1993-01-01   13.193    2713000       538.1    1.117
## 206 1993-02-01   12.698    2641000       524.2    1.108
## 207 1993-03-01   13.041    2687500       521.2    1.098
## 208 1993-04-01   14.235    2775500       543.0    1.112
## 209 1993-05-01   14.212    2778400       552.0    1.129
## 210 1993-06-01   14.188    2812000       548.6    1.130
## 211 1993-07-01   14.143    2782800       558.6    1.109
## 212 1993-08-01   13.276    2803250       551.5    1.097
## 213 1993-09-01   13.676    2826000       559.8    1.085
## 214 1993-10-01   14.603    2825000       568.9    1.127
## 215 1993-11-01   14.539    2800750       574.2    1.113
## 216 1993-12-01   14.679    2762250       578.3    1.070
## 217 1994-01-01   15.035    2709600       579.6    1.043
## 218 1994-02-01   15.194    2792500       593.3    1.051
## 219 1994-03-01   14.974    2754500       593.6    1.045
## 220 1994-04-01   15.680    2736600       607.0    1.064
## 221 1994-05-01   14.249    2752750       588.9    1.080
## 222 1994-06-01   14.763    2720000       600.3    1.106
## 223 1994-07-01   14.522    2659600       602.1    1.136
## 224 1994-08-01   14.989    2647500       612.0    1.182
## 225 1994-09-01   14.911    2629250       613.8    1.177
## 226 1994-10-01   15.517    2574000       629.6    1.152
## 227 1994-11-01   15.500    2532250       635.1    1.163
## 228 1994-12-01   15.196    2528800       630.7    1.143
## 229 1995-01-01   14.363    2512500       623.6    1.129
## 230 1995-02-01   14.457    2522500       613.0    1.120
## 231 1995-03-01   14.865    2531250       627.2    1.115
## 232 1995-04-01   13.980    2519400       613.2    1.140
## 233 1995-05-01   14.418    2573000       624.8    1.200
## 234 1995-06-01   15.019    2606750       642.8    1.226
## 235 1995-07-01   14.326    2622800       631.0    1.195
## 236 1995-08-01   15.006    2607250       645.3    1.164
## 237 1995-09-01   14.959    2626800       651.3    1.148
## 238 1995-10-01   14.470    2663250       638.1    1.127
## 239 1995-11-01   15.012    2672000       650.6    1.101
## 240 1995-12-01   15.862    2612600       668.0    1.101
## 241 1996-01-01   14.449    2648750       645.8    1.129
## 242 1996-02-01   15.215    2692750       663.2    1.124
## 243 1996-03-01   15.679    2685000       670.4    1.162
## 244 1996-04-01   15.112    2633500       679.5    1.251
## 245 1996-05-01   15.624    2590500       680.1    1.323
## 246 1996-06-01   14.864    2548000       669.4    1.299
## 247 1996-07-01   14.700    2490000       672.9    1.272
## 248 1996-08-01   15.128    2494400       681.7    1.240
## 249 1996-09-01   15.184    2473000       683.6    1.234
## 250 1996-10-01   14.972    2460250       688.8    1.227
## 251 1996-11-01   15.392    2428600       692.2    1.250
## 252 1996-12-01   14.849    2487750       687.8    1.260
## 253 1997-01-01   15.332    2487750       703.3    1.261
## 254 1997-02-01   14.916    2415000       702.0    1.255
## 255 1997-03-01   15.444    2347600       711.5    1.235
## 256 1997-04-01   14.694    2324250       697.5    1.231
## 257 1997-05-01   14.717    2302800       690.2    1.226
## 258 1997-06-01   14.180    2295500       702.1    1.229
## 259 1997-07-01   15.194    2269500       715.7    1.205
## 260 1997-08-01   15.765    2272400       732.6    1.253
## 261 1997-09-01   14.711    2234750       720.0    1.277
## 262 1997-10-01   15.036    2215500       724.7    1.242
## 263 1997-11-01   15.421    2215000       740.8    1.213
## 264 1997-12-01   16.059    2235250       746.1    1.177
## 265 1998-01-01   14.400    2275200       733.0    1.131
## 266 1998-02-01   14.839    2224250       739.4    1.082
## 267 1998-03-01   15.001    2221750       740.7    1.041
## 268 1998-04-01   15.521    2182500       758.1    1.052
## 269 1998-05-01   16.649    2134600       778.3    1.092
## 270 1998-06-01   16.378    2214250       771.3    1.094
## 271 1998-07-01   14.255    2333750       769.4    1.079
## 272 1998-08-01   14.358    2237600       784.9    1.052
## 273 1998-09-01   15.862    2153000       800.9    1.033
## 274 1998-10-01   16.679    2164400       819.4    1.042
## 275 1998-11-01   15.631    2203750       817.9    1.028
## 276 1998-12-01   16.943    2220250       838.2    0.986
## 277 1999-01-01   16.094    2287200       808.4    0.972
## 278 1999-02-01   16.566    2240500       824.1    0.955
## 279 1999-03-01   16.332    2227000       827.4    0.991
## 280 1999-04-01   16.422    2237500       841.3    1.177
## 281 1999-05-01   17.059    2214400       855.4    1.178
## 282 1999-06-01   16.839    2192250       867.7    1.148
## 283 1999-07-01   17.171    2193200       865.2    1.189
## 284 1999-08-01   17.121    2180250       871.9    1.255
## 285 1999-09-01   17.116    2162000       876.4    1.280
## 286 1999-10-01   17.139    2102800       868.0    1.274
## 287 1999-11-01   17.072    2085750       871.2    1.264
## 288 1999-12-01   17.793    2097250       889.8    1.298
## 289 2000-01-01   18.114    2109800       908.6    1.301
## 290 2000-02-01   18.879    2147500       930.7    1.369
## 291 2000-03-01   17.822    2079000       923.3    1.541
## 292 2000-04-01   17.442    2015400       900.6    1.506
## 293 2000-05-01   17.467    1989500       907.0    1.498
## 294 2000-06-01   17.078    2028250       898.2    1.617
## 295 2000-07-01   16.851    2085600       897.3    1.593
## 296 2000-08-01   17.090    2117250       906.4    1.510
## 297 2000-09-01   18.245    2119600       931.3    1.582
## 298 2000-10-01   17.117    2116250       920.6    1.559
## 299 2000-11-01   16.259    2211250       913.4    1.555
## 300 2000-12-01   15.831    2306400       913.5    1.489
## 301 2001-01-01   17.251    2395750       916.5    1.472
## 302 2001-02-01   17.433    2486500       938.9    1.484
## 303 2001-03-01   16.868    2585400       925.1    1.447
## 304 2001-04-01   16.531    2697250       908.3    1.564
## 305 2001-05-01   16.503    2819250       916.0    1.729
## 306 2001-06-01   17.104    2947400       934.1    1.640
## 307 2001-07-01   16.123    3030750       925.0    1.482
## 308 2001-08-01   16.016    3120000       942.5    1.427
## 309 2001-09-01   16.056    3262200       904.1    1.531
## 310 2001-10-01   21.709    3527500      1035.1    1.362
## 311 2001-11-01   17.725    3656500       997.0    1.263
## 312 2001-12-01   16.147    3589400       955.6    1.131
## 313 2002-01-01   16.220    3550500       970.7    1.139
## 314 2002-02-01   17.005    3554250       983.2    1.130
## 315 2002-03-01   16.788    3610800       974.9    1.241
## 316 2002-04-01   17.343    3689250      1001.5    1.407
## 317 2002-05-01   15.844    3712000       962.7    1.421
## 318 2002-06-01   16.626    3635200       968.0    1.404
## 319 2002-07-01   17.829    3504250      1001.6    1.412
## 320 2002-08-01   18.105    3516800      1019.7    1.423
## 321 2002-09-01   16.326    3555000       983.9    1.422
## 322 2002-10-01   15.923    3555750       969.9    1.449
## 323 2002-11-01   16.195    3482400       978.5    1.448
## 324 2002-12-01   17.593    3482750      1009.9    1.394
## 325 2003-01-01   16.426    3414500       982.6    1.473
## 326 2003-02-01   15.814    3437000       956.4    1.641
## 327 2003-03-01   16.173    3540800       984.6    1.748
## 328 2003-04-01   16.433    3629750      1003.9    1.659
## 329 2003-05-01   16.152    3719200      1005.7    1.542
## 330 2003-06-01   16.686    3701500      1013.9    1.514
## 331 2003-07-01   16.777    3616250      1024.9    1.524
## 332 2003-08-01   17.931    3596400      1059.3    1.628
## 333 2003-09-01   16.945    3575750      1041.1    1.728
## 334 2003-10-01   16.143    3486250      1036.2    1.603
## 335 2003-11-01   17.197    3373400      1053.5    1.535
## 336 2003-12-01   16.992    3270250      1051.5    1.494
## 337 2004-01-01   16.304    3148200      1048.1    1.592
## 338 2004-02-01   16.634    3114750      1065.2    1.672
## 339 2004-03-01   16.837    3046250      1079.4    1.766
## 340 2004-04-01   16.493    3000750      1062.8    1.833
## 341 2004-05-01   17.759    2975600      1091.5    2.009
## 342 2004-06-01   15.761    2950750      1043.6    2.041
## 343 2004-07-01   16.870    2917000      1076.9    1.939
## 344 2004-08-01   16.717    2891500      1079.0    1.898
## 345 2004-09-01   17.432    2862750      1099.3    1.891
## 346 2004-10-01   17.056    2778000      1098.6    2.029
## 347 2004-11-01   16.912    2734500      1099.9    2.010
## 348 2004-12-01   17.627    2719000      1122.6    1.882
## 349 2005-01-01   16.370    2723800      1096.4    1.823
## 350 2005-02-01   16.403    2686500      1113.2    1.918
## 351 2005-03-01   16.930    2659500      1120.2    2.065
## 352 2005-04-01   17.274    2604400      1142.8    2.283
## 353 2005-05-01   16.928    2586250      1116.4    2.216
## 354 2005-06-01   17.967    2600000      1154.6    2.176
## 355 2005-07-01   20.607    2595200      1202.2    2.316
## 356 2005-08-01   16.917    2580750      1139.5    2.506
## 357 2005-09-01   16.427    2716500      1113.8    2.927
## 358 2005-10-01   14.847    2803400      1099.6    2.785
## 359 2005-11-01   16.022    2701250      1116.4    2.343
## 360 2005-12-01   16.688    2639400      1128.2    2.186
## 361 2006-01-01   17.572    2557000      1167.9    2.315
## 362 2006-02-01   16.515    2507250      1143.5    2.310
## 363 2006-03-01   16.409    2455500      1151.0    2.401
## 364 2006-04-01   16.568    2401000      1151.0    2.757
## 365 2006-05-01   16.170    2383750      1147.2    2.947
## 366 2006-06-01   16.352    2408500      1149.5    2.917
## 367 2006-07-01   17.125    2449400      1168.7    2.999
## 368 2006-08-01   15.901    2466250      1146.0    2.985
## 369 2006-09-01   16.419    2446200      1166.9    2.589
## 370 2006-10-01   16.322    2446250      1168.3    2.272
## 371 2006-11-01   16.128    2476000      1164.4    2.241
## 372 2006-12-01   16.569    2481200      1175.5    2.334
## 373 2007-01-01   16.402    2524250      1183.5    2.274
## 374 2007-02-01   16.704    2569250      1175.1    2.285
## 375 2007-03-01   16.015    2519000      1178.5    2.592
## 376 2007-04-01   16.215    2496000      1181.2    2.860
## 377 2007-05-01   16.296    2447750      1197.7    3.130
## 378 2007-06-01   15.823    2482000      1178.2    3.052
## 379 2007-07-01   15.499    2542250      1180.7    2.961
## 380 2007-08-01   16.034    2553000      1192.4    2.782
## 381 2007-09-01   16.200    2537200      1202.6    2.789
## 382 2007-10-01   16.127    2561750      1209.0    2.793
## 383 2007-11-01   16.038    2616750      1197.7    3.069
## 384 2007-12-01   15.718    2712000      1180.0    3.020
## 385 2008-01-01   15.383    2798750      1168.4    3.047
## 386 2008-02-01   15.166    2844250      1148.4    3.033
## 387 2008-03-01   14.795    2912800      1143.7    3.258
## 388 2008-04-01   14.268    2964000      1139.1    3.441
## 389 2008-05-01   14.364    3013600      1143.7    3.764
## 390 2008-06-01   14.065    3057750      1130.4    4.065
## 391 2008-07-01   12.715    3176250      1100.0    4.090
## 392 2008-08-01   13.834    3378000      1114.3    3.786
## 393 2008-09-01   12.688    3521750      1073.2    3.698
## 394 2008-10-01   10.666    3731000      1026.6    3.173
## 395 2008-11-01   10.255    4096600      1002.4    2.151
## 396 2008-12-01   10.141    4522250       995.0    1.689
## 397 2009-01-01    9.573    4861200      1023.0    1.787
## 398 2009-02-01    9.023    5297000      1006.2    1.928
## 399 2009-03-01    9.552    5765750       984.2    1.949
## 400 2009-04-01    9.197    6184500       978.8    2.056
## 401 2009-05-01    9.996    6525600       998.9    2.265
## 402 2009-06-01    9.956    6534250      1006.4    2.631
## 403 2009-07-01   11.370    6139000      1020.8    2.543
## 404 2009-08-01   14.568    6047800      1089.1    2.627
## 405 2009-09-01    9.347    5984750       995.4    2.574
## 406 2009-10-01   10.371    5765600      1003.6    2.561
## 407 2009-11-01   10.817    5460500      1017.4    2.660
## 408 2009-12-01   11.060    5141750      1021.6    2.621
## 409 2010-01-01   10.669    4839000      1006.1    2.731
## 410 2010-02-01   10.108    4793750      1005.2    2.659
## 411 2010-03-01   11.553    4731750      1052.0    2.780
## 412 2010-04-01   11.249    4728000      1046.0    2.858
## 413 2010-05-01   11.821    4674800      1041.7    2.869
## 414 2010-06-01   11.385    4583250      1044.1    2.736
## 415 2010-07-01   11.715    4528600      1047.5    2.736
## 416 2010-08-01   11.802    4461250      1053.7    2.745
## 417 2010-09-01   11.703    4467750      1056.1    2.704
## 418 2010-10-01   12.199    4363400      1079.2    2.795
## 419 2010-11-01   12.070    4195500      1077.5    2.852
## 420 2010-12-01   12.383    4100000      1078.7    2.985
## 421 2011-01-01   12.547    3918400      1085.0    3.091
## 422 2011-02-01   12.815    3849250      1083.8    3.167
## 423 2011-03-01   12.984    3765500      1095.0    3.546
## 424 2011-04-01   13.037    3770800      1090.9    3.816
## 425 2011-05-01   11.980    3773750      1081.2    3.933
## 426 2011-06-01   11.581    3741750      1076.6    3.702
## 427 2011-07-01   12.419    3721600      1085.7    3.654
## 428 2011-08-01   12.277    3716000      1085.2    3.630
## 429 2011-09-01   13.026    3742750      1101.3    3.612
## 430 2011-10-01   13.391    3701600      1114.4    3.468
## 431 2011-11-01   13.406    3652500      1107.9    3.423
## 432 2011-12-01   13.455    3573400      1114.9    3.278
## 433 2012-01-01   14.058    3451250      1130.4    3.399
## 434 2012-02-01   14.617    3381750      1145.9    3.572
## 435 2012-03-01   14.237    3336800      1138.0    3.868
## 436 2012-04-01   14.408    3323000      1137.4    3.927
## 437 2012-05-01   14.135    3328000      1133.4    3.792
## 438 2012-06-01   14.118    3324400      1129.9    3.552
## 439 2012-07-01   14.027    3305750      1134.7    3.451
## 440 2012-08-01   14.092    3306250      1138.4    3.707
## 441 2012-09-01   14.759    3314400      1151.9    3.856
## 442 2012-10-01   14.514    3276250      1141.2    3.786
## 443 2012-11-01   15.130    3326250      1169.4    3.488
## 444 2012-12-01   15.121    3190200      1180.1    3.331
## 445 2013-01-01   15.474    3132750      1192.6    3.351
## 446 2013-02-01   15.516    3058750      1193.2    3.693
## 447 2013-03-01   15.412    3037800      1180.5    3.735
## 448 2013-04-01   15.451    3041500      1182.3    3.590
## 449 2013-05-01   15.537    3012250      1187.1    3.623
## 450 2013-06-01   15.774    2992800      1186.9    3.633
## 451 2013-07-01   15.674    3020250      1190.8    3.628
## 452 2013-08-01   15.486    2934400      1187.7    3.600
## 453 2013-09-01   15.506    2895750      1188.3    3.556
## 454 2013-10-01   15.354    2928500      1191.4    3.375
## 455 2013-11-01   15.714    2851200      1201.7    3.251
## 456 2013-12-01   15.463    2858500      1190.4    3.277
## 457 2014-01-01   15.249    2876750      1173.9    3.320
## 458 2014-02-01   15.617    2848750      1204.7    3.364
## 459 2014-03-01   16.606    2779200      1231.9    3.532
## 460 2014-04-01   16.280    2721000      1230.3    3.659
## 461 2014-05-01   16.737    2667400      1238.6    3.691
## 462 2014-06-01   17.125    2588750      1249.4    3.695
## 463 2014-07-01   16.851    2533500      1248.4    3.633
## 464 2014-08-01   16.808    2504800      1258.6    3.481
## 465 2014-09-01   16.527    2447750      1259.8    3.403
## 466 2014-10-01   16.326    2423250      1263.7    3.182
## 467 2014-11-01   16.544    2408800      1272.8    2.887
## 468 2014-12-01   16.757    2380000      1272.7    2.560
## 469 2015-01-01   16.497    2349800      1272.6    2.110
## 470 2015-02-01   16.455    2340250      1276.2    2.249
## 471 2015-03-01   17.416    2326500      1297.7    2.483
## 472 2015-04-01   17.197    2281500      1304.9    2.485
## 473 2015-05-01   17.562    2260400      1311.7    2.775
## 474 2015-06-01   17.390    2273750      1306.3    2.832
## 475 2015-07-01   17.837    2244750      1315.6    2.832
## 476 2015-08-01   17.973    2254000      1319.3    2.679
## 477 2015-09-01   17.792    2243000      1315.2    2.394
## 478 2015-10-01   17.748    2207600      1307.2    2.289
## 479 2015-11-01   17.858    2208500      1321.9    2.185
## 480 2015-12-01   17.031    2203750      1322.1    2.060
## 481 2016-01-01   17.631    2204600      1321.5    1.967
## 482 2016-02-01   17.585    2188000      1341.7    1.767
## 483 2016-03-01   16.868    2166250      1326.8    1.958
## 484 2016-04-01   17.295    2155200      1334.9    2.134
## 485 2016-05-01   17.351    2175750      1338.4    2.264
## 486 2016-06-01   17.337    2159000      1356.5    2.363
## 487 2016-07-01   17.729    2141200      1364.3    2.225
## 488 2016-08-01   17.523    2148000      1360.3    2.155
## 489 2016-09-01   17.585    2113500      1370.2    2.208
## 490 2016-10-01   17.493    2075200      1373.9    2.243
## 491 2016-11-01   17.374    2048250      1356.2    2.187
## 492 2016-12-01   17.806    2056400      1387.0    2.230
## 493 2017-01-01   17.300    2036250      1385.4    2.351
## 494 2017-02-01   17.386    2018000      1386.2    2.299
## 495 2017-03-01   16.710    1996500      1383.7    2.323
## 496 2017-04-01   16.863    1974200      1394.4    2.418
## 497 2017-05-01   16.851    1944000      1394.8    2.386
## 498 2017-06-01   16.796    1962500      1406.8    2.337
## 499 2017-07-01   16.771    1961000      1411.4    2.281
## 500 2017-08-01   16.590    1953500      1402.0    2.374
## 501 2017-09-01   17.951    1951000      1434.3    2.630
## 502 2017-10-01   17.768    1922750      1441.4    2.484
## 503 2017-11-01   17.416    1927500      1452.5    2.548
## 504 2017-12-01   17.235    1894600      1457.7    2.459
## 505 2018-01-01   17.130    1908250      1455.5    2.539
## 506 2018-02-01   17.080    1860250      1453.2    2.575
## 507 2018-03-01   17.220    1830400      1455.7    2.572
## 508 2018-04-01   17.312    1813250      1471.6    2.737
## 509 2018-05-01   17.309    1746750      1481.0    2.907
## 510 2018-06-01   17.215    1734000      1477.4    2.914
## 511 2018-07-01   16.890    1749500      1481.0    2.873
## 512 2018-08-01   16.857    1723750      1489.6    2.862
## 513 2018-09-01   17.316    1685400      1485.0    2.873
## 514 2018-10-01   17.478    1657500      1489.6    2.887
## 515 2018-11-01   17.379    1681250      1509.3    2.671
## 516 2018-12-01   17.377    1695200      1458.0    2.414
## 517 2019-01-01   16.711    1716750      1483.4    2.289
## 518 2019-02-01   16.519    1729250      1463.8    2.353
## 519 2019-03-01   17.260    1724000      1508.9    2.564
## 520 2019-04-01   16.483    1673000      1507.8    2.835
## 521 2019-05-01   17.385    1682750      1529.0    2.901
## 522 2019-06-01   17.178    1697000      1537.1    2.752
## 523 2019-07-01   16.876    1691750      1541.8    2.776
## 524 2019-08-01   16.974    1694200      1545.6    2.655
## 525 2019-09-01   17.148    1678000      1561.7    2.630
## 526 2019-10-01   16.520    1693750      1541.7    2.673
## 527 2019-11-01   16.985    1692200      1553.1    2.620
## 528 2019-12-01   16.647    1736000      1548.1    2.587
## 529 2020-01-01   16.914    1737750      1557.7    2.567
## 530 2020-02-01   16.737    1703800      1550.0    2.465
## 531 2020-03-01   11.372    3497750      1124.0    2.267
set.seed(420)
#train and test data for car sales 
split3=caTools::sample.split(car_sales$Sales,SplitRatio = 0.8)
training_set3=subset(car_sales,split3==TRUE)
test_set3=subset(car_sales,split3==FALSE)

#Fitting regression model to the training set (Unemployment, Consumption, and GasPrices)
regressor3=lm(formula=car_sales$Sales[0:531]~Unemployment$Unemployed[109:639] + Consumption$Personal_Consumption[205:735] + GasPrices$Gas_Price[0:531],
                data=training_set3)

#Prediction values
y_pred3=predict(regressor3,newdata=test_set3)
## Warning: 'newdata' had 107 rows but variables found have 531 rows
#plot new prediction (best fit)
new_date3 = car_sales$Date[0:531]
car_pred3 = plot_ly(car_sales, x = new_date3, y = y_pred3, type= 'scatter', mode='lines', color='red') 




car_pred3
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
#subplot show advancement in our model (Blue is OG data, Orange are models to fit, bottom graph being most advanced)
subplot(car_plot, car_pred1, car_pred2, car_pred3, nrows = 4, margin = 0.05, shareX = TRUE)
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
#residual plot
plot(residuals(regressor3))

#plot forecast with our prediction model 3, 36 month term
data2 = data.frame(Date = new_date3,
                   Prediction = y_pred3)
ts.data = ts(data2, frequency=12)
fit <- auto.arima(ts.data[,2], D=1)
fore <- forecast(fit, h=36)




plot(fore)

#plot forecast with our prediction model 3, 72 month term
data3 = data.frame(Date = new_date3,
                   Prediction = y_pred3)

ts.data1 = ts(data3, frequency=12)
fit1 <- auto.arima(ts.data1[,2], D=1)
fore1 <- forecast(fit, h=72)

plot(fore1)

#Forecasted values (3yr)

fore
##        Point Forecast    Lo 80    Hi 80     Lo 95    Hi 95
## Apr 45       13.17735 12.85911 13.49559 12.690646 13.66406
## May 45       12.69182 12.15186 13.23179 11.866015 13.51763
## Jun 45       12.26681 11.55478 12.97885 11.177857 13.35577
## Jul 45       12.10190 11.23457 12.96923 10.775434 13.42837
## Aug 45       12.07533 11.06862 13.08204 10.535700 13.61496
## Sep 45       12.07100 10.94157 13.20042 10.343692 13.79830
## Oct 45       12.22256 10.98413 13.46098 10.328553 14.11656
## Nov 45       12.42809 11.09205 13.76413 10.384788 14.47139
## Dec 45       12.63111 11.20723 14.05499 10.453479 14.80875
## Jan 46       12.73769 11.23435 14.24104 10.438523 15.03687
## Feb 46       12.80448 11.22885 14.38011 10.394757 15.21420
## Mar 46       12.60391 10.96222 14.24560 10.093158 15.11466
## Apr 46       12.51248 10.80663 14.21834  9.903603 15.12137
## May 46       12.49557 10.72939 14.26175  9.794424 15.19671
## Jun 46       12.58190 10.75972 14.40409  9.795109 15.36870
## Jul 46       12.74447 10.87010 14.61885  9.877860 15.61108
## Aug 46       12.86950 10.94649 14.79251  9.928508 15.81049
## Sep 46       12.95284 10.98452 14.92115  9.942562 15.96311
## Oct 46       13.14922 11.13866 15.15978 10.074330 16.22411
## Nov 46       13.38980 11.33978 15.43982 10.254565 16.52503
## Dec 46       13.58866 11.50175 15.67557 10.397005 16.78031
## Jan 47       13.70955 11.58811 15.83100 10.465082 16.95402
## Feb 47       13.75095 11.59714 15.90476 10.456978 17.04492
## Mar 47       13.57966 11.39548 15.76384 10.239246 16.92008
## Apr 47       13.47476 11.26033 15.68920 10.088073 16.86145
## May 47       13.45449 11.21095 15.69802 10.023300 16.88567
## Jun 47       13.54347 11.27239 15.81455 10.070149 17.01679
## Jul 47       13.68372 11.38650 15.98094 10.170432 17.19701
## Aug 47       13.80274 11.48079 16.12469 10.251619 17.35386
## Sep 47       13.88155 11.53623 16.22687 10.294696 17.46841
## Oct 47       14.03602 11.66863 16.40340 10.415414 17.65662
## Nov 47       14.25636 11.86813 16.64458 10.603879 17.90883
## Dec 47       14.42385 12.01594 16.83176 10.741273 18.10643
## Jan 48       14.53136 12.10485 16.95787 10.820340 18.24238
## Feb 48       14.57249 12.12841 17.01657 10.834589 18.31038
## Mar 48       14.01340 11.55270 16.47409 10.250091 17.77670
#forecasted values (6yr)


fore1
##        Point Forecast    Lo 80    Hi 80     Lo 95    Hi 95
## Apr 45       13.17735 12.85911 13.49559 12.690646 13.66406
## May 45       12.69182 12.15186 13.23179 11.866015 13.51763
## Jun 45       12.26681 11.55478 12.97885 11.177857 13.35577
## Jul 45       12.10190 11.23457 12.96923 10.775434 13.42837
## Aug 45       12.07533 11.06862 13.08204 10.535700 13.61496
## Sep 45       12.07100 10.94157 13.20042 10.343692 13.79830
## Oct 45       12.22256 10.98413 13.46098 10.328553 14.11656
## Nov 45       12.42809 11.09205 13.76413 10.384788 14.47139
## Dec 45       12.63111 11.20723 14.05499 10.453479 14.80875
## Jan 46       12.73769 11.23435 14.24104 10.438523 15.03687
## Feb 46       12.80448 11.22885 14.38011 10.394757 15.21420
## Mar 46       12.60391 10.96222 14.24560 10.093158 15.11466
## Apr 46       12.51248 10.80663 14.21834  9.903603 15.12137
## May 46       12.49557 10.72939 14.26175  9.794424 15.19671
## Jun 46       12.58190 10.75972 14.40409  9.795109 15.36870
## Jul 46       12.74447 10.87010 14.61885  9.877860 15.61108
## Aug 46       12.86950 10.94649 14.79251  9.928508 15.81049
## Sep 46       12.95284 10.98452 14.92115  9.942562 15.96311
## Oct 46       13.14922 11.13866 15.15978 10.074330 16.22411
## Nov 46       13.38980 11.33978 15.43982 10.254565 16.52503
## Dec 46       13.58866 11.50175 15.67557 10.397005 16.78031
## Jan 47       13.70955 11.58811 15.83100 10.465082 16.95402
## Feb 47       13.75095 11.59714 15.90476 10.456978 17.04492
## Mar 47       13.57966 11.39548 15.76384 10.239246 16.92008
## Apr 47       13.47476 11.26033 15.68920 10.088073 16.86145
## May 47       13.45449 11.21095 15.69802 10.023300 16.88567
## Jun 47       13.54347 11.27239 15.81455 10.070149 17.01679
## Jul 47       13.68372 11.38650 15.98094 10.170432 17.19701
## Aug 47       13.80274 11.48079 16.12469 10.251619 17.35386
## Sep 47       13.88155 11.53623 16.22687 10.294696 17.46841
## Oct 47       14.03602 11.66863 16.40340 10.415414 17.65662
## Nov 47       14.25636 11.86813 16.64458 10.603879 17.90883
## Dec 47       14.42385 12.01594 16.83176 10.741273 18.10643
## Jan 48       14.53136 12.10485 16.95787 10.820340 18.24238
## Feb 48       14.57249 12.12841 17.01657 10.834589 18.31038
## Mar 48       14.01340 11.55270 16.47409 10.250091 17.77670
## Apr 48       13.75379 11.27263 16.23494  9.959190 17.54839
## May 48       13.68256 11.18010 16.18502  9.855379 17.50974
## Jun 48       13.71623 11.19305 16.23941  9.857361 17.57510
## Jul 48       13.82079 11.27738 16.36419  9.930989 17.71058
## Aug 48       13.91930 11.35637 16.48222  9.999639 17.83895
## Sep 48       13.98362 11.40205 16.56519 10.035448 17.93179
## Oct 48       14.13111 11.53179 16.73043 10.155798 18.10643
## Nov 48       14.34362 11.72744 16.95979 10.342514 18.34472
## Dec 48       14.50810 11.87592 17.14027 10.482536 18.53366
## Jan 49       14.60940 11.96207 17.25674 10.560659 18.65815
## Feb 49       14.64702 11.98533 17.30872 10.576310 18.71774
## Mar 49       14.11406 11.43875 16.78937 10.022528 18.20559
## Apr 49       13.86390 11.17181 16.55599  9.746704 17.98110
## May 49       13.79205 11.08245 16.50165  9.648076 17.93603
## Jun 49       13.82506 11.09840 16.55172  9.654989 17.99513
## Jul 49       13.92967 11.18632 16.67302  9.734083 18.12526
## Aug 49       14.02548 11.26599 16.78497  9.805210 18.24575
## Sep 49       14.08655 11.31163 16.86148  9.842672 18.33044
## Oct 49       14.23374 11.44410 17.02339  9.967353 18.50014
## Nov 49       14.44411 11.64046 17.24776 10.156302 18.73192
## Dec 49       14.60718 11.79023 17.42413 10.299031 18.91533
## Jan 50       14.70579 11.87622 17.53537 10.378333 19.03325
## Feb 50       14.73936 11.89781 17.58091 10.393579 19.08514
## Mar 50       14.23609 11.38317 17.08900  9.872931 18.59924
## Apr 50       13.99539 11.12849 16.86230  9.610843 18.37994
## May 50       13.92429 11.04279 16.80579  9.517411 18.33117
## Jun 50       13.95856 11.06281 16.85430  9.529895 18.38722
## Jul 50       14.06262 11.15293 16.97231  9.612637 18.51260
## Aug 50       14.15680 11.23362 17.07999  9.686173 18.62743
## Sep 50       14.21583 11.27971 17.15194  9.725424 18.70623
## Oct 50       14.36009 11.41164 17.30854  9.850818 18.86936
## Nov 50       14.56786 11.60766 17.52807 10.040617 19.09510
## Dec 50       14.72791 11.75653 17.69929 10.183576 19.27224
## Jan 51       14.82399 11.84200 17.80598 10.263425 19.38455
## Feb 51       14.85498 11.86291 17.84705 10.278998 19.43096
## Mar 51       14.34342 11.34178 17.34506  9.752806 18.93403